package io.renren.modules.gasstation.realtimedata.controller;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.gasstation.realtimedata.service.RealTimeDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author：T-weiwei
 * @Description: 加油站实时数据接口层
 * @Email：tweiwei@aliyun.com
 * @CreateDate：2022-02-23-下午4:45
 * @CopyRight：http://www.huaxun.ink/
 * @Hint： This content is limited to the internal circulation of HuaXun Hi Tech Co., Ltd.,
 * and is forbidden to be leaked and used for other commercial purposes
 **/
@RestController
@RequestMapping("realtime")
public class RealTimeDataController {

    /**
     * 加油站实时数据业务层
     */
    @Autowired
    private RealTimeDataService realTimeDataService;

    /**
     * 普通列表分页接口
     * @return 返回对象
     */
    @GetMapping("ordinaryList")
    public R ordinaryList(@RequestParam Map<String, Object> params) {
        PageUtils page = realTimeDataService.queryPage(params);
        return R.ok().put("page", page);
    }

    /**
     * 普通列表分页接口
     * @return 返回对象
     */
    @GetMapping("newList")
    public R newList(@RequestParam Map<String, Object> params) {
        PageUtils page = this.realTimeDataService.newQueryPage(params);
        return R.ok().put("page", page);
    }
}
